home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / usr / lib / X11 / config / gnuLib.rules < prev    next >
Encoding:
Text File  |  2006-12-20  |  8.9 KB  |  277 lines

  1. /*
  2.  * GNU/Hurd shared library rules
  3.  *
  4.  * $XFree86: xc/config/cf/gnuLib.rules,v 1.9 2003/10/11 09:40:13 herrb Exp $
  5.  */
  6.  
  7. /*
  8.  * GNU/Hurd shared library rules
  9.  * Cloned from Linux (ELF) shared library rules
  10.  *
  11.  */
  12.  
  13. #ifndef HasSharedLibraries
  14. #define HasSharedLibraries YES
  15. #endif
  16. #ifndef ForceNormalLib
  17. #define ForceNormalLib NO
  18. #endif
  19.  
  20. #ifndef UseRpath
  21. #define UseRpath NO
  22. #endif
  23.  
  24. #ifndef SharedOldX
  25. #define SharedOldX NO
  26. #endif
  27.  
  28. #ifndef SpecialMalloc
  29. #define SpecialMalloc NO
  30. #endif
  31.  
  32. # ifndef BaseShLibReqs
  33. #define BaseShLibReqs   -lc
  34. # endif
  35.  
  36. #ifndef SharedDataSeparation
  37. #define SharedDataSeparation NO
  38. #endif
  39. #ifndef SharedCodeDef
  40. #define SharedCodeDef /**/
  41. #endif
  42. #ifndef SharedLibraryDef
  43. #define SharedLibraryDef /**/
  44. #endif
  45. #ifndef ShLibIncludeFile
  46. #define ShLibIncludeFile <gnuLib.tmpl>
  47. #endif
  48. #ifndef RpathLoadFlags
  49. #if UseRpath
  50. #define RpathLoadFlags -Wl,-rpath,$(USRLIBDIRPATH)
  51. #else
  52. #define RpathLoadFlags /**/
  53. #endif
  54. #endif
  55. #ifndef LibraryRpathLoadFlags
  56. #define LibraryRpathLoadFlags RpathLoadFlags
  57. #endif
  58. #ifndef SharedLibraryLoadFlags
  59. #  define SharedLibraryLoadFlags -shared
  60. #endif
  61. #ifndef PositionIndependentCFlags
  62. #define PositionIndependentCFlags -fPIC
  63. #endif
  64. #ifndef PositionIndependentCplusplusFlags
  65. #define PositionIndependentCplusplusFlags -fPIC
  66. #endif
  67. #ifndef ExtraLoadFlags
  68. #  define ExtraLoadFlags RpathLoadFlags
  69. # endif
  70. # ifndef HardCodeLibdirFlag
  71. #  define HardCodeLibdirFlag RpathLoadFlags
  72. #endif
  73. # if !defined(ShlibGlobalsFlags)
  74. #  define ShlibGlobalsFlags -Wl,-Bsymbolic
  75. #endif
  76.  
  77. /*
  78.  * InstallSharedLibrary - generate rules to install the shared library.
  79.  * NOTE: file must be executable, hence "INSTBINFLAGS"
  80.  */
  81. #ifndef InstallSharedLibrary
  82. #define InstallSharedLibrary(libname,rev,dest)                @@\
  83. install:: Concat(lib,libname.so.rev)                     @@\
  84.     MakeDir($(DESTDIR)dest)                        @@\
  85.     $(INSTALL) $(INSTALLFLAGS) $(INSTBINFLAGS) Concat(lib,libname.so.rev) $(DESTDIR)dest @@\
  86.     @T=`echo Concat($(DESTDIR)dest/lib,libname.so.rev) | sed 's/\(lib[^\.]*\.so\.[0-9]*\)\(\.[0-9]*\)\{1,2\}/\1/'`;\
  87.       set -x; $(RM) $$T && $(LN) Concat(lib,libname.so.rev) $$T    @@\
  88.     @if $(SOSYMLINK); then (set -x; \
  89.       $(RM) Concat($(DESTDIR)dest/lib,libname.so); \        @@\
  90.       $(LN) Concat(lib,libname.so.rev) Concat($(DESTDIR)dest/lib,libname.so)); fi
  91. #endif /* InstallSharedLibrary */
  92.  
  93. # ifndef InstallSharedLibtoolLibrary
  94.  
  95. #  define SetRevisions(rev) V=`expr rev : '\([^:]*\)'`; \        @@\
  96.         R=`expr rev : '.*:\([^:]*\):'`; \            @@\
  97.         A=`expr rev : '.*:\([^:]*\)'`; \            @@\
  98.         MAJ=`expr $$V - $$A`; \                    @@\
  99.         MIN=$$A.$$R
  100.  
  101. #  define    InstallSharedLibtoolLibrary(libname,rev,dest)        @@\
  102. install:: Concat(lib,libname.so)                     @@\
  103.     MakeDir($(DESTDIR)dest)                        @@\
  104.     @set +e; SetRevisions(rev); \                    @@\
  105.         set -xe; \                        @@\
  106.         $(INSTALL) $(INSTALLFLAGS) $(INSTBINFLAGS) Concat(lib,libname.so.$$MAJ.$$MIN) $(DESTDIR)dest; \ @@\
  107.         $(RM) Concat($(DESTDIR)dest/lib,libname.so.$$MAJ); \    @@\
  108.         $(LN) Concat(lib,libname.so.$$MAJ.$$MIN) Concat($(DESTDIR)dest/lib,libname.so.$$MAJ); \ @@\
  109.         $(RM) Concat($(DESTDIR)dest/lib,libname.so); \        @@\
  110.         $(LN) Concat(lib,libname.so.$$MAJ.$$MIN) Concat($(DESTDIR)dest/lib,libname.so)
  111. # endif /* InstallSharedLibrary */
  112.  
  113. /*
  114.  * InstallSharedLibraryData - generate rules to install the shared library data
  115.  */
  116. #ifndef InstallSharedLibraryData
  117. #define InstallSharedLibraryData(libname,rev,dest)
  118. #endif /* InstallSharedLibraryData */
  119.  
  120.  
  121. /*
  122.  * SharedLibraryTarget - generate rules to create a shared library;
  123.  * build it into a different name so that we do not hose people by having
  124.  * the library gone for long periods.
  125.  */
  126. #ifndef SharedLibraryTarget
  127. #define SharedLibraryTarget(libname,rev,solist,down,up)            @@\
  128. AllTarget(Concat(lib,libname.so.rev))                    @@\
  129.                                     @@\
  130. Concat(lib,libname.so.rev):  solist $(EXTRALIBRARYDEPS)            @@\
  131.     $(RM) $@~                            @@\
  132.     @SONAME=`echo $@ | sed 's/\(lib[^\.]*\.so\.[0-9]*\)\(\.[0-9]*\)\{1,2\}/\1/'`; (set -x; \    @@\
  133.         cd down; $(CC) -o up/$@~ $(SHLIBLDFLAGS) -Wl,-soname,$$SONAME solist $(REQUIREDLIBS) BaseShLibReqs) || exit 1; \ @@\
  134.         (set -x; $(RM) $$SONAME; $(LN) $@ $$SONAME); \        @@\
  135.         LinkBuildSonameLibrary($$SONAME)            @@\
  136.     $(RM) $@                            @@\
  137.     $(MV) $@~ $@                            @@\
  138.     @if $(SOSYMLINK); then (set -x; \                @@\
  139.       $(RM) Concat(lib,libname.so); \                @@\
  140.       $(LN) $@ Concat(lib,libname.so)); fi                @@\
  141.     LinkBuildLibrary($@)                        @@\
  142.     LinkBuildLibraryMaybe(Concat(lib,libname.so),$(SOSYMLINK))    @@\
  143.                                     @@\
  144. clean::                                    @@\
  145.     @MAJREV=`echo rev | sed 's/\([0-9]*\)\(\.[0-9]*\)\{1,2\}/\1/'`; \    @@\
  146.     set -x; $(RM) Concat(lib,libname.so.$$MAJREV)            @@\
  147.     $(RM) Concat(lib,libname.so.rev) Concat(lib,libname.so)
  148.  
  149. #endif /* SharedLibraryTarget */
  150.  
  151.  
  152. # ifndef SharedLibtoolLibraryTarget
  153. #  define SharedLibtoolLibraryTarget(libname,rev,solist,down,up)    @@\
  154. AllTarget(Concat(lib,libname.so))                    @@\
  155.                                     @@\
  156. Concat(lib,libname.so):  solist $(EXTRALIBRARYDEPS)            @@\
  157.     $(RM) $@~                            @@\
  158.     @set +e; SetRevisions(rev); set -e; \                @@\
  159.         SONAME=$@.$$MAJ; \                    @@\
  160.         (set -x; \                        @@\
  161.         $(RM) $@.$$MAJ.$$MIN~; \                @@\
  162.         cd down; $(CC) -o up/$@.$$MAJ.$$MIN~ $(SHLIBLDFLAGS) -Wl,-soname,$$SONAME solist $(REQUIREDLIBS) BaseShLibReqs) || exit 1; \ @@\
  163.         (set -x; \                        @@\
  164.         $(RM) $$SONAME; $(LN) $@.$$MAJ.$$MIN $$SONAME); \    @@\
  165.         LinkBuildSonameLibrary($$SONAME); \            @@\
  166.         (set -x; \                        @@\
  167.         $(RM) $@.$$MAJ.$$MIN; \                    @@\
  168.         $(MV) $@.$$MAJ.$$MIN~ $@.$$MAJ.$$MIN; \            @@\
  169.           $(RM) $@; \                        @@\
  170.           $(LN) $@.$$MAJ.$$MIN $@); \                @@\
  171.         LinkBuildLibraryInline($@.$$MAJ.$$MIN); \        @@\
  172.         LinkBuildLibraryInline($@)                @@\
  173.                                     @@\
  174. clean::                                    @@\
  175.     @set +e; SetRevisions(rev); \                    @@\
  176.         set -xe; \                        @@\
  177.         $(RM) Concat(lib,libname.so.$$MAJ); \            @@\
  178.         $(RM) Concat(lib,libname.so.$$MAJ.$$MIN)        @@\
  179.     $(RM) Concat(lib,libname.so)
  180.  
  181. # endif /* SharedLibtoolLibraryTarget */
  182.  
  183. /*
  184.  * SharedDepLibraryTarget - generate rules to create a shared library.
  185.  */
  186. #ifndef SharedDepLibraryTarget
  187. #define SharedDepLibraryTarget(libname,rev,deplist,solist,down,up)    @@\
  188. AllTarget(Concat(lib,libname.so.rev))                    @@\
  189.                                     @@\
  190. Concat(lib,libname.so.rev):  deplist $(EXTRALIBRARYDEPS)        @@\
  191.     $(RM) $@~                            @@\
  192.     @SONAME=`echo $@ | sed 's/\(lib[^\.]*\.so\.[0-9]*\)\(\.[0-9]*\)\{1,2\}/\1/'`; set -x; \        @@\
  193.         (cd down; $(CC) -o up/$@~ $(SHLIBLDFLAGS) -Wl,-soname,$$SONAME solist $(REQUIREDLIBS) BaseShLibReqs); \ @@\
  194.         $(RM) $$SONAME; $(LN) $@ $$SONAME; \            @@\
  195.         LinkBuildSonameLibrary($$SONAME)            @@\
  196.     $(RM) $@                             @@\
  197.     $(MV) $@~ $@                            @@\
  198.     @if $(SOSYMLINK); then (set -x; \                @@\
  199.       $(RM) Concat(lib,libname.so); \                @@\
  200.       $(LN) $@ Concat(lib,libname.so)); fi                @@\
  201.     LinkBuildLibrary($@)                        @@\
  202.     LinkBuildLibraryMaybe(Concat(lib,libname.so),$(SOSYMLINK))    @@\
  203.                                     @@\
  204. clean::                                    @@\
  205.     @MAJREV=`echo rev | sed 's/\([0-9]*\)\(\.[0-9]*\)\{1,2\}/\1/'`; \    @@\
  206.     set -x; $(RM) Concat(lib,libname.so.$$MAJREV)            @@\
  207.     $(RM) Concat(lib,libname.so.rev) Concat(lib,libname.so)
  208.  
  209. #endif /* SharedDepLibraryTarget */
  210.  
  211. /*
  212.  * SharedDepCplusplusLibraryTarget - generate rules to create a shared library.
  213.  */
  214. #ifndef SharedDepCplusplusLibraryTarget
  215. #define SharedDepCplusplusLibraryTarget(libname,rev,deplist,solist,down,up) @@\
  216. AllTarget(Concat(lib,libname.so.rev))                    @@\
  217.                                     @@\
  218. Concat(lib,libname.so.rev):  deplist $(EXTRALIBRARYDEPS)        @@\
  219.     $(RM) $@~                            @@\
  220.     @SONAME=`echo $@ | sed 's/\(lib[^\.]*\.so\.[0-9]*\)\(\.[0-9]*\)\{1,2\}/\1/'`; set -x; \        @@\
  221.         (cd down; $(CXX) -o up/$@~ $(SHLIBLDFLAGS) -Wl,-soname,$$SONAME solist $(REQUIREDLIBS) BaseShLibReqs); \ @@\
  222.         $(RM) $$SONAME; $(LN) $@ $$SONAME; \            @@\
  223.         LinkBuildSonameLibrary($$SONAME)            @@\
  224.     $(RM) $@                             @@\
  225.     $(MV) $@~ $@                            @@\
  226.     @if $(SOSYMLINK); then (set -x; \                @@\
  227.       $(RM) Concat(lib,libname.so); \                @@\
  228.       $(LN) $@ Concat(lib,libname.so)); fi                @@\
  229.     LinkBuildLibrary($@)                        @@\
  230.     LinkBuildLibraryMaybe(Concat(lib,libname.so),$(SOSYMLINK))    @@\
  231.                                     @@\
  232. clean::                                    @@\
  233.     @MAJREV=`echo rev | sed 's/\([0-9]*\)\(\.[0-9]*\)\{1,2\}/\1/'`; \    @@\
  234.     set -x; $(RM) Concat(lib,libname.so.$$MAJREV)            @@\
  235.     $(RM) Concat(lib,libname.so.rev) Concat(lib,libname.so)
  236.  
  237. #endif /* SharedDepCplusplusLibraryTarget */
  238.  
  239. #ifndef SharedDepModuleTarget
  240. #define SharedDepModuleTarget(name,deps,solist)                @@\
  241. AllTarget(name)                                @@\
  242.                                     @@\
  243. name: deps                                @@\
  244.     $(RM) $@~                            @@\
  245.     $(CC) -o $@~ $(SHLIBLDFLAGS) solist $(REQUIREDLIBS) BaseShLibReqs @@\
  246.     $(RM) $@                            @@\
  247.     $(MV) $@~ $@                            @@\
  248.                                     @@\
  249. clean::                                    @@\
  250.     $(RM) name
  251.  
  252. #endif /* SharedDepModuleTarget */
  253.  
  254. # ifndef SharedDriModuleTarget
  255. #  define SharedDriModuleTarget(name,deps,solist)            @@\
  256. AllTarget(name)                                @@\
  257.                                     @@\
  258. name: deps                                @@\
  259.     $(RM) $@~ $@.map                        @@\
  260.     @(echo 'DRI_MODULE { global: __dri*; local: *; };' > $@.map)    @@\
  261.     $(CC) -o $@~ -Wl,--version-script=$@.map $(SHLIBLDFLAGS) solist $(REQUIREDLIBS) BaseShLibReqs @@\
  262.     $(RM) $@ $@.map                            @@\
  263.     $(MV) $@~ $@                            @@\
  264.                                     @@\
  265. clean::                                    @@\
  266.     $(RM) name                            @@\
  267.     $(RM) name.map
  268.  
  269. # endif /* SharedDriModuleTarget */
  270.  
  271. /*
  272.  * SharedLibraryDataTarget - generate rules to create shlib data file;
  273.  */
  274. #ifndef SharedLibraryDataTarget
  275. #define SharedLibraryDataTarget(libname,rev,salist)
  276. #endif /* SharedLibraryTarget */
  277.